extends "../weiqita-1/weiqita-1.gd"


func _extInit():
	._extInit()
	lv = 2             #等级的设置
	addSkill("每次炮击有30%概率追加一次炮击", "连续射击")
var p3 = 1
func normalAtkChara(cha):
	if sys.rndPer(30):
		if lv >= 3:
			repel(cha)
		normalAtkChara(cha)
	.normalAtkChara(cha)

#击退
func repel(cha):
	var tmp = cha.cell
	if doRepel(cell, cha):
		doRepel(tmp, cha)

func doRepel(from, cha):
	var matCell = cha.cell - from
	matCell.x = max(-1, matCell.x)
	matCell.x = min(1, matCell.x)
	matCell.y = max(-1, matCell.y)
	matCell.y = min(1, matCell.y)
	matCell += cha.cell
	if not sys.main.isMatin(matCell) or matCha(matCell) != null:
		azurHurtChara(cha, att.atk*2, sys.HurtType.WEAPON, sys.AtkType.SKILL, "动能打击", true, p3)
		cha.addBuff(buff.b_shaoShi.new(5))
	else:
		cha.setCell(matCell)